Change FindValueOfExpression signature to return symbolic.Expression#27
Merged
kwesiRutledge merged 3 commits intocopilot/create-get-optimal-objective-value-functionfrom Oct 14, 2025
Conversation
Co-authored-by: kwesiRutledge <9002730+kwesiRutledge@users.noreply.github.com>
Co-authored-by: kwesiRutledge <9002730+kwesiRutledge@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Change FindValueOfExpression signature and update GetOptimalObjectiveValue
Change FindValueOfExpression signature to return symbolic.Expression
Oct 14, 2025
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## copilot/create-get-optimal-objective-value-function #27 +/- ##
======================================================================================
Coverage ? 87.33%
======================================================================================
Files ? 35
Lines ? 4185
Branches ? 0
======================================================================================
Hits ? 3655
Misses ? 474
Partials ? 56 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3023d9b
into
copilot/create-get-optimal-objective-value-function
5 checks passed
kwesiRutledge
added a commit
that referenced
this pull request
Oct 15, 2025
…solution point (#26) * Initial plan * Implement GetOptimalObjectiveValue function with comprehensive tests Co-authored-by: kwesiRutledge <9002730+kwesiRutledge@users.noreply.github.com> * Change FindValueOfExpression signature to return symbolic.Expression (#27) * Initial plan * Change FindValueOfExpression signature to return symbolic.Expression Co-authored-by: kwesiRutledge <9002730+kwesiRutledge@users.noreply.github.com> * Add helper function to reduce code duplication in tests Co-authored-by: kwesiRutledge <9002730+kwesiRutledge@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kwesiRutledge <9002730+kwesiRutledge@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kwesiRutledge <9002730+kwesiRutledge@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR changes the
FindValueOfExpressionfunction signature to return(symbolic.Expression, error)instead of(float64, error), wheresymbolic.Expressioncomes from the SymbolicMath.go library. This change provides a more flexible API while maintaining backward compatibility for existing callers.Changes
Core Function Updates
FindValueOfExpressioninsolution/solution.go:(float64, error)to(symbolic.Expression, error)GetOptimalObjectiveValueinsolution/solution.go:FindValueOfExpressionsignaturesymbolic.Expressiontosymbolic.K(float64, error)return type for backward compatibilityTest Updates
testing/solution/solution_test.go:exprToFloat64to reduce code duplicationFindValueOfExpressionto handle the new return typeBenefits
FindValueOfExpressionfocuses solely on substitution, delegating conversion to the callerTesting
All existing tests pass successfully:
TestSolution_FindValueOfExpression*- All 5 test cases passTestSolution_GetOptimalObjectiveValue*- All 4 test cases passExample Usage
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.